<?php
// 简单的测试脚本来检查分类数据
require_once 'vendor/autoload.php';

// 模拟分类数据
$expenseCategories = [
    (object)[
        'id' => 1,
        'name' => '餐饮',
        'icon' => '🍽️',
        'subCategories' => [
            (object)['id' => 1, 'name' => '早餐', 'icon' => '🥐'],
            (object)['id' => 2, 'name' => '午餐', 'icon' => '🍱'],
            (object)['id' => 3, 'name' => '晚餐', 'icon' => '🍽️'],
            (object)['id' => 4, 'name' => '夜宵', 'icon' => '🌙'],
        ]
    ],
    (object)[
        'id' => 2,
        'name' => '交通',
        'icon' => '🚗',
        'subCategories' => [
            (object)['id' => 6, 'name' => '公交', 'icon' => '🚌'],
            (object)['id' => 7, 'name' => '地铁', 'icon' => '🚇'],
            (object)['id' => 8, 'name' => '打车', 'icon' => '🚕'],
            (object)['id' => 9, 'name' => '加油', 'icon' => '⛽'],
        ]
    ],
];

$incomeCategories = [
    (object)[
        'id' => 9,
        'name' => '工资',
        'icon' => '💰',
        'subCategories' => [
            (object)['id' => 50, 'name' => '月薪', 'icon' => '📅'],
            (object)['id' => 51, 'name' => '年终奖', 'icon' => '🎁'],
            (object)['id' => 52, 'name' => '加班费', 'icon' => '⏰'],
            (object)['id' => 53, 'name' => '绩效奖金', 'icon' => '🏆'],
        ]
    ],
    (object)[
        'id' => 10,
        'name' => '投资',
        'icon' => '📈',
        'subCategories' => [
            (object)['id' => 54, 'name' => '股票', 'icon' => '📊'],
            (object)['id' => 55, 'name' => '基金', 'icon' => '💹'],
            (object)['id' => 56, 'name' => '存款利息', 'icon' => '🏦'],
            (object)['id' => 57, 'name' => '其他理财', 'icon' => '💎'],
        ]
    ],
];

echo "支出分类数量: " . count($expenseCategories) . "\n";
echo "收入分类数量: " . count($incomeCategories) . "\n";

foreach ($expenseCategories as $cat) {
    echo "支出分类: {$cat->name} ({$cat->icon}) - 子分类数量: " . count($cat->subCategories) . "\n";
}

foreach ($incomeCategories as $cat) {
    echo "收入分类: {$cat->name} ({$cat->icon}) - 子分类数量: " . count($cat->subCategories) . "\n";
}
?>